<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set> 
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>采购记录查询</title>

    <link rel="shortcut icon" href="${ctx}/favicon.ico"> <link href="${ctx}/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="${ctx}/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="${ctx}/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="${ctx}/css/animate.css" rel="stylesheet">
    <link href="${ctx}/css/style.css?v=4.1.0" rel="stylesheet">
</head>

<body>
        <div class="row">
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        
                        <div class="ibox-content" >
                            <div class="row">
                                
                                    <span class="label label-default" style="font-size:18px;">商品名称:</span>
                                    <input type="text" name="goods_name" style="font-size:18px;" autocomplete="off"/>
                                    <span class="label label-default" style="font-size:18px;">采&nbsp;&nbsp;购&nbsp;&nbsp;人:</span>
                                    <input type="text" name="purchase_name" style="font-size:18px;" autocomplete="off"/>
                                    <span class="label label-default" style="font-size:18px;">厂&nbsp;&nbsp;&nbsp;&nbsp;商:</span>
                                    <input type="text" name="supplier_" style="font-size:18px;" autocomplete="off"/>
                                    <div type="button" onclick="findInfo()" class="btn btn-info" style="font-size:16px;margin-left:30px;">&nbsp;&nbsp;查&nbsp;&nbsp;&nbsp;&nbsp;找&nbsp;&nbsp;</div>
                                
                            </div>
                            <div class="table-responsive" style="height:430px;">
                                <table class="table table-striped">
                                    <thead>
                                    <tr>
                                        <th>商品名称</th>
                                        <th>价格</th>
                                        <th>规格</th>
                                        <th>数量</th>
                                        <th>采购人</th>
                                        <th>厂商</th>
                                        <th>采购入库时间</th>
                                        <th>审核状态</th>
                                        <th>仓库</th>
                                        <th>备注</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    	<c:forEach var="purchase" items="${purchaseList}">
                                        	<tr>     
                                                 <td>${purchase.goods_name}</td>
                                                 <td>${purchase.price}</td>
                                                 <td>${purchase.unit}</td>
                                                 <td>${purchase.number}</td>
                                                 <td>${purchase.purchase_name}</td>
                                                 <td>${purchase.supplier_}</td>
                                                 <td>${purchase.purchase_time}</td>
                                                 <td>${purchase.inspect}</td>
                                                 <td>${purchase.storehouse_name}</td>                                                                                             
                                                 <td>${purchase.remark}</td>
                                         	</tr>
                                     	</c:forEach>
                                    </tbody>
                                </table>
                            </div> 
                            <div>
                            	<!-- <span style="float:left;">共25条数据5页</span> -->
                            	<div id="page" style="text-align:right;"></div>
                            </div>      
                        </div>
                    </div>
                </div>       
        </div>
</body>
<!-- 全局js -->
<script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
<script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>
<script src="${ctx}/dist/jquery-bootstrap-pagination/jquery-bootstrap-pagination.js"></script>
<script type="text/javascript">
	//分页
	$("#page").pagination({
	  total_pages:${pageCount},
	  current_page:${pageNum},
	  prev: "上一页",
	  next: "下一页",
	  display_max:4,
	  callback: function(event, page) {
	      //return alert("Page " + page + " was clicked!");
	      location="${ctx}/PurchaseServlet/findPurchseInfo?pageNum="+page;
	}
	});  


	function findInfo(){
		param=$('[name=goods_name]').add('[name=purchase_name]').add('[name=supplier_]').serialize();
		location="${ctx}/PurchaseServlet/findByCondition?"+param;
	}
</script>
</html>